import QtQuick 1.0

Rectangle
{
	id : menulog
	width : 310
	radius : 10
	color : "#3399cc"
	x : - width + 36

	PropertyAnimation { id: animationOpen; target: menulog; property: "x"; to: -width+36; duration: 500 }
	PropertyAnimation { id: animationClose; target: menulog; property: "x"; to: -10; duration: 500 }


	function open()
	{
		animationOpen.running = true
		immenulog.source = "menuright.png"

		Image
		{
			id: imgButtonEcg
		}
	}

	function close()
	{
		animationClose.running = true
		immenulog.source = "menuleft.png"
	}
	
	Image
	{
		id : immenulog
		width : 72
		height : 72
		x : parent.width - 36
		y : parent.height/2 - 36
		source : "menuright.png"
		
		MouseArea
		{
			id:menuButton
			anchors.fill: parent
			onClicked: 
			{
				if (parent.parent.x == -10) { menulog.open() }
				else { menulog.close() }
			}
		}
	}

	Image
	{
		id: imgButtonEcg
		source: "buttonEcg.png"
		width: 80
		height: 60

		MouseArea
		{
			id: test
			anchors.fill:parent
			onClicked:
			{
				container.ecgSignal()
			}

		}
	}
}
